import Home from "@/pages/home/index";
import Article from "@/pages/article/index";
import PersonalCenter from '@/pages/personal-center/index'
import Layout from "@/pages/layout/index";
import Login from "@/pages/login/index";
import Register from "@/pages/register/index";
import { lazy } from "react";
import { useRoutes } from "react-router-dom";
const NotFound = lazy(() => import("@/pages/not-found/index"));

// const Question = lazy(() => import('@/pages/Question'))

function Wrapper() {
	return useRoutes([
		{
			path: "/",
			element: <Layout />,
			children: [
				{
					// path:'/',
					index: true,
					element: <Home />,
					
				},
				{
					path: "/article/:id",
					element: <Article />,
				},
				{
					path: "/personalcenter",
					element: <PersonalCenter />,
				},
			],
		},
		{
			path: "/register",
			element: <Register />,
		},
		{
			path: "/login",
			element: <Login />,
		},
		{
			path: "*",
			element: <NotFound />,
		},
	]);
}

export default Wrapper;
